class TrendTable {
  int[][] hourlyCount;
  String[] topTopic;

  TrendTable() {
  }

  TrendTable(String filename) {
    String[] rows = loadStrings(filename);

    hourlyCount = new int[rows.length][2];
    topTopic = new String[rows.length];

    for(int i=0; i<rows.length; i++) {
      String[] pieces = split(rows[i], TAB);

      hourlyCount[i][0] = parseInt(pieces[0]);
      hourlyCount[i][1] = parseInt(pieces[1]);
      topTopic[i] = pieces[2];
    }
  }
  int getCountMin() {
    int count,index=0; 
    int mini = 100000;
    for(int i=0; i<23;i++) {
      count=0;
      for(int j=0; j<5; j++) {
        count+=hourlyCount[index][1];
        index++;
      }
      //  println(count);
      if(count<mini) mini = count;
    }
    return mini;
  }
  int getCountMax() {
    int count,index=0; 
    int maxi = 0;
    for(int i=0; i<23;i++) {
      count=0;
      for(int j=0; j<5; j++) {
        count+=hourlyCount[index][1];
        index++;
      }
      if(count>maxi) maxi = count;
    }
    return maxi;
  }
}

